Vue.createApp({
	data() {
		return {
			show:true,
			form:{},
			tableData:[
				{
					id:1,
					name:'张三',
					email:'zhangsan@example.com',
					phone:'13656844325',
					role:'管理员',
					status:'启用'
				},
				{
					id:2,
					name:'李四',
					email:'lisi@example.com',
					phone:'13656844325',
					role:'编辑',
					status:'启用'
				},
				{
					id:3,
					name:'王五',
					email:'wangwu@example.com',
					phone:'13656844325',
					role:'查看者',
					status:'禁用'
				},
				{
					id:4,
					name:'赵六',
					email:'zhaoliu@example.com',
					phone:'13656844325',
					role:'编辑',
					status:'启用'
				},
				{
					id:5,
					name:'钱七',
					email:'qianqi@example.com',
					phone:'13656844325',
					role:'查看者',
					status:'启用'
				}
			]
		}
	},
	methods:{
		del(i){
			this.$confirm('确认删除该用户?','提示',{
				type:'warning',
				confirmButtonText:'确认',
				cancelButtonText:'取消',
			}).then(()=>{
				this.tableData.splice(i,1)
				this.$message({
					type:'success',
					message:'删除成功'
				});
			})
		},
		add(){
			//校验数据
			
			//添加数据
			this.form.id=this.tableData.length+1
			this.tableData.push(this.form)
			this.form={}
			this.show=false
		}
	}
}).use(ElementPlus).mount('#app')